
package com.colourclash.fruitopia.utils
{
	import com.colourclash.fruitopia.events.PropertyChangeEvent;
	import flash.events.EventDispatcher;
	
	/**
	 * ...
	 * @author Patrick
	 */
	public class BaseModel extends EventDispatcher
	{
		private static var idCount:int = 0;
		public var id:String;
		
		public function BaseModel()
		{
			super();
			
			id = String(++idCount);
		}
		
		public function propertyChanged(propertyName:String, ... rest):void
		{
			trace("model propertyChanged: " + propertyName);
			Global.getInstance().stage.dispatchEvent(new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE, this, propertyName, rest, true));
		}
	}

}